<!DOCTYPE html>
<html lang="en">
<head>
    <title>在哪</title>
    <meta name="App-Config" content="fullscreen=yes,useHistoryState=yes,transition=yes">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta content="telephone=no,email=no" name="format-detection">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,viewport-fit=cover">
    <meta name="author" content="去哪">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta content="telephone=no,email=no" name="format-detection">
    <script>
        !function(e,t){function n(){t.body?t.body.style.fontSize=12*o+"px":t.addEventListener("DOMContentLoaded",n)}function d(){var e=i.clientWidth/10;i.style.fontSize=e+"px"}var i=t.documentElement,o=e.devicePixelRatio||1;if(n(),d(),e.addEventListener("resize",d),e.addEventListener("pageshow",function(e){e.persisted&&d()}),o>=2){var a=t.createElement("body"),s=t.createElement("div");s.style.border=".5px solid transparent",a.appendChild(s),i.appendChild(a),1===s.offsetHeight&&i.classList.add("hairlines"),i.removeChild(a)}}(window,document);
    </script>
    <link rel="stylesheet" type="text/css" href="/v1/css/core.css?v20180809">
    <link rel="stylesheet" type="text/css" href="/v1/css/share.css?v2018093010243">
</head>
<body>
<div class="container">
  <div class="topBox">
    <img src="/v1/images/wxBanner.png" alt="">
  </div>
  <div class="talkBox">
    <div class="talkLi clearfix">
      <img src="<?php echo $data['avatar'];?>" alt="" class="avatar">
      <div class="talkRBox">
        <div class="topId"><?php if(!empty( $data['nickname'])){echo $data['nickname'];}else{echo '在哪';}?></div>
        <div class="topPop">
          与你分享我的位置
        </div>
      </div>
    </div>
    <div class="talkLi clearfix">
      <img src="<?php echo $data['avatar'];?>" alt="" class="avatar">
      <div class="talkRBox">
        <div class="topId"><?php if(!empty( $data['nickname'])){echo $data['nickname'];}else{echo '在哪';}?></div>
        <div class="topPop">
          让守护看的见
        </div>
      </div>
    </div>
  </div>
  <button class="downloadBtn" data-clipboard-text="<?php echo $data['code']?>">
    同意好友请求
  </button>
  <div class="layer_outer hidden" id="cantCopyPop">
    <div class="layer_inner">
      <div class="popInner_title">
        无法进行复制，请手动复制 <br>
        <div class="popInner_Copy"><?php echo $data['code']?></div>
      </div>
      <div class="btn_box">
        <div class="btn primary_btn" id="goJump" onclick="goJump">复制好了，立即跳转</div>
      </div>
    </div>
  </div>
</div>
<script src="https://cdn.jsdelivr.net/npm/zepto@1.2.0/dist/zepto.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script>
<script>
  var clipboard = new ClipboardJS('.downloadBtn');

  clipboard.on('success', function(e) {
    console.info('Action:', e.action);
    console.info('Text:', e.text);
    console.info('Trigger:', e.trigger);
    goJump()
    e.clearSelection();
  });

  clipboard.on('error', function(e) {
    $('.cantCopyPop').removeClass('hidden')
    console.error('Action:', e.action);
    console.error('Trigger:', e.trigger);
  });
  function goJump() {
    if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
      window.location.href = "https://apps.apple.com/cn/app/id1528279564"
    }else {
      alert('安卓版本正在研发中，敬请期待')
    }
    $('.cantCopyPop').addClass('hidden')
    $('.cantCopyPop').addClass('hidden')
  }
</script>
</body>
</html>
